﻿using System;
using UnityEngine;

// Token: 0x020003E4 RID: 996
internal class ShortClick
{
	// Token: 0x1700025D RID: 605
	// (get) Token: 0x060018CF RID: 6351 RVA: 0x000A1948 File Offset: 0x0009FB48
	// (set) Token: 0x060018D0 RID: 6352 RVA: 0x000A1950 File Offset: 0x0009FB50
	public bool IsShortClickNow { get; private set; }

	// Token: 0x060018D1 RID: 6353 RVA: 0x000A195C File Offset: 0x0009FB5C
	public void Update()
	{
		this.IsShortClickNow = false;
		if (Input.GetMouseButtonDown(0) && !GameCursor.OnUI && GameCursor.IsDraw)
		{
			this.Down();
		}
		if (Input.GetMouseButtonUp(0))
		{
			this.Up();
		}
		if (this.clicking)
		{
			this.move += GameCursor.move.magnitude;
			this.timer += Time.deltaTime;
		}
	}

	// Token: 0x060018D2 RID: 6354 RVA: 0x000A19E0 File Offset: 0x0009FBE0
	private void Down()
	{
		this.timer = 0f;
		this.move = 0f;
		this.clicking = true;
	}

	// Token: 0x060018D3 RID: 6355 RVA: 0x000A1A00 File Offset: 0x0009FC00
	private void Up()
	{
		if (this.clicking && this.timer <= this.timeLimit && this.move <= this.moveLimit)
		{
			this.IsShortClickNow = true;
		}
		this.clicking = false;
	}

	// Token: 0x04001C31 RID: 7217
	private bool clicking;

	// Token: 0x04001C32 RID: 7218
	private float timer;

	// Token: 0x04001C33 RID: 7219
	private float timeLimit = 0.3f;

	// Token: 0x04001C34 RID: 7220
	private float moveLimit = 10f;

	// Token: 0x04001C35 RID: 7221
	private float move;
}
